package weiyao.xinxidasai.service;

import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import weiyao.xinxidasai.Utils.ThreadLocal.UserHolder;
import weiyao.xinxidasai.pojo.FFiles;
import weiyao.xinxidasai.service.model.ChunkInfo;

import java.io.IOException;
@Service
public interface DownloadService {
    // 普通文件下载
    ResponseEntity<Resource> downloadFile(Long fileId) throws IOException;

    // 分片下载初始化（获取文件信息和分片数量）
    FFiles initChunkDownload(Long fileId);

    // 下载单个分片
    ResponseEntity<Resource> downloadChunk(Long fileId, Integer chunkIndex, Long chunkSize) throws IOException;


}